#include "string.h"
#include "stdio.h"
#include "stdint.h"
using namespace std;

uint8_t GetCommandLen(char* Command)
{
	char* indexCommandLen = Command;
	uint8_t Len = 0;
	while(*indexCommandLen != '\0')
	{
		Len++;
		indexCommandLen++;
	}
	return Len;
}

uint8_t FindSignalIndex(char* Command)
{
	uint8_t indexCommand = 0, LenCommand = GetCommandLen(Command);
	while(indexCommand < LenCommand)
    {
        if(Command[indexCommand] == '$') break;
        indexCommand ++;   
    }
    return indexCommand;
}

// SpeedNumber means Compare Value
uint16_t GetSpeedNumber(char* NumberIndex)
{
	uint16_t SpeedNumber = 0;
	while(*NumberIndex >= '0' && *NumberIndex <= '9')
	{
		SpeedNumber = SpeedNumber * 10 + *NumberIndex - '0';
		NumberIndex ++;
	}
	return SpeedNumber;
}

// 给出开头即为Command的字符串，实现方向和速度设置
char CommandList[10][5] = {
"For","Bac","Lef","Rig","RiR","Spe"
};

void ExtractCommandFromStr(char* Command)
{
    uint8_t DividSignal = FindSignalIndex(Command);
	uint16_t SpeedNumber = GetSpeedNumber(Command+DividSignal+1);

    if(memcmp(Command, CommandList[0], 3) == 3) {   
    //    SetMotorDiretionForward();
		puts(CommandList[0]);
	}
    if(memcmp(Command, CommandList[1], 3) == 3) {
    //    SetMotorDiretionBackward();
		puts(CommandList[1]);
    }
    if(memcmp(Command, CommandList[2], 3) == 3) {
    //    SetMotorDiretionTurnLeft();
		puts(CommandList[2]);
	}
    if(memcmp(Command, CommandList[3], 3) == 3) {
    //    SetMotorDiretionTurnRight();
		puts(CommandList[3]);
    }
	if(memcmp(Command, CommandList[4], 3) == 3) {
    //    SetMotorDiretionTurnRight();
		puts(CommandList[4]);
    }
    if(memcmp(Command, CommandList[5], 3) == 3) {
    //    SetMotorDirectionRightRevolve();
		puts(CommandList[5]);
    }
    if(memcmp(Command, CommandList[6], 3) == 3) {
	//    SetChassisSpeedByCCR(uint16_t ChassisCCR); 
		puts(CommandList[6]);
    }
}

int main()
{
	char str[10];
	scanf("%s",&str);
	ExtractCommandFromStr(str);

	puts("Finish");

	return 0;
}
